# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=lomiri-indicator-network
pkgver=1.0.2
pkgrel=0
pkgdesc="The 'Network' indicator for Ubuntu Touch"
# armhf blocked by qt5-qtdeclarative
arch="all !armhf"
url="https://gitlab.com/ubports/development/core/lomiri-indicator-network"
license="GPL-3.0-only"
depends_dev="
	glib-dev
	gmenuharness-dev
	gtest-dev
	libqofono-dev
	libsecret-dev
	lomiri-api-dev
	lomiri-url-dispatcher-dev
	networkmanager-dev
	ofono-dev
	qt5-qtdeclarative-dev
	"
makedepends="
	$depends_dev
	cmake-extras
	gmock
	intltool
	libqtdbusmock
	libqtdbustest
	qt5-qttools
	samurai
	"
checkdepends="py3-dbusmock"
source="https://gitlab.com/ubports/development/core/lomiri-indicator-network/-/archive/$pkgver/lomiri-indicator-network-$pkgver.tar.gz
	0001-Use-CMAKE_INSTALL_FULL_-for-installing.patch
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
options="!check" # some tests hang

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None \
		-DUSE_SYSTEMD=OFF
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
bdb722678fc0ef1c3ff133c3beaeb7419bdc5a5c255888b1e82cf938f438ff6a758b0904d7780e2fe045e4ecd8e31ad10e7bf526f85d49093125d5e907dc945e  lomiri-indicator-network-1.0.2.tar.gz
89c26a655f62a82a74dab87ee5757335723c99e1da93c0797975c14a362edb45573a64fc6e335cd561f53ab2a3b3954bd58c1550b489f6b7418588fdafd33bee  0001-Use-CMAKE_INSTALL_FULL_-for-installing.patch
"
